csssection: Remove file argument from constructor
authorBenjamin Otte <otte@redhat.com>
Wed, 18 Apr 2012 20:15:32 +0000 (22:15 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 11 May 2012 14:42:12 +0000 (16:42 +0200)
The parser has the file available.

gtk/gtkcssprovider.c
gtk/gtkcsssection.c
gtk/gtkcsssectionprivate.h

index d57ccd062bb692de9e0d83e0ffa7e6c14a10bfca..748bff760f3d427c2103fd270c28e8d77fe189df 100644 (file)
@@ -1406,8 +1406,7 @@ gtk_css_scanner_push_section (GtkCssScanner     *scanner,
 
   section = _gtk_css_section_new (scanner->section,
                                   section_type,
-                                  scanner->parser,
-                                  scanner->file);
+                                  scanner->parser);
 
   if (scanner->section)
     gtk_css_section_unref (scanner->section);
index 007a308b9bb9c20195554a4b7c314ebd5fcaca14..85fd0647eff63925a39f3aced1b4428d286bb1d9 100644 (file)
@@ -49,13 +49,11 @@ G_DEFINE_BOXED_TYPE (GtkCssSection, gtk_css_section, gtk_css_section_ref, gtk_cs
 GtkCssSection *
 _gtk_css_section_new (GtkCssSection     *parent,
                       GtkCssSectionType  type,
-                      GtkCssParser      *parser,
-                      GFile             *file)
+                      GtkCssParser      *parser)
 {
   GtkCssSection *section;
 
   g_return_val_if_fail (parser != NULL, NULL);
-  g_return_val_if_fail (file == NULL || G_IS_FILE (file), NULL);
 
   section = g_slice_new0 (GtkCssSection);
 
@@ -63,8 +61,9 @@ _gtk_css_section_new (GtkCssSection     *parent,
   section->section_type = type;
   if (parent)
     section->parent = gtk_css_section_ref (parent);
-  if (file)
-    section->file = g_object_ref (file);
+  section->file = _gtk_css_parser_get_file (parser);
+  if (section->file)
+    g_object_ref (section->file);
   section->start_line = _gtk_css_parser_get_line (parser);
   section->start_position = _gtk_css_parser_get_position (parser);
   section->parser = parser;
index ddf7b37ee3e8ddb41dc333b37cdb55e556d8d2ee..12c13aaba038e09e60581f049a02e98de1f56428 100644 (file)
@@ -26,8 +26,7 @@ G_BEGIN_DECLS
 
 GtkCssSection *    _gtk_css_section_new                (GtkCssSection        *parent,
                                                         GtkCssSectionType     type,
-                                                        GtkCssParser         *parser,
-                                                        GFile                *file);
+                                                        GtkCssParser         *parser);
 GtkCssSection *    _gtk_css_section_new_for_file       (GtkCssSectionType     type,
                                                         GFile                *file);